<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let arr =[0,1,0,3,2,3];

        function getLongestIncreateArr(arr) {
            let saveArr = [],
                len = 0,
                maxIndex = 0;

            for (let i = 0; i < arr.length; i++) {
                let temp = arr[i]
                saveArr[i] = [];
                saveArr[i].push(arr[i]);
                for (let j = i + 1; j < arr.length; j++) {
                    if (arr[j] > temp) {
                        saveArr[i].push(arr[j]);
                        temp = arr[j];
                    }
                }
            }

            console.log(saveArr);

            for (let i = 0; i < saveArr.length; i++) {
                if (saveArr[i].length >= len) {
                    maxIndex = i;
                    len = saveArr[i].length;
                }
            }
            return saveArr[maxIndex];
        }

        console.log(getLongestIncreateArr(arr));
    </script>
</body>

</html>